<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
	<style type="text/css">
		 p:nth-child(2){
		 	color: red;
		 }
		/*	选中偶数行同类型的p	 */
		 p:nth-of-type(2n){
		 	background: pink;
		 }
		/*	选中的是同类型的p	 */
		 p:first-of-type{
		 	text-decoration: underline;
		 }
		/*	选中的是最后一个同类型的p	 */
		 p:last-of-type{
		 	font-size: 30px;
		 }
	</style>
</head>
<body>
	<span>我是span</span>
 	<p>这是p</p>
 	<p>这是p</p>
 	<p>这是p</p>
 	<p>这是p</p>
 	<p>这是p</p>
 	<p>这是p</p>
 	<p>这是p</p>
 	<p>这是p</p>
 	<p>这是p</p>
</body>
</html>